<?php  header("Content-Type:text/html;charset=utf-8"); ?>
<html>
<head>
	<style>
		#specie_info{
			border: solid 1px black;
			background-color: #c9e378;
			text-align: center;
		}
		#spe_desc, #gen_desc, #fam_desc, #ord_desc, #cla_desc, #phy_desc{
			margin-top: 0px;
			margin-bottom: 0px;
		}
	</style>
</head>
<body>
<?php
	include "console_command.php";

	$mydbconn = dbConn();

  _console_OP_getMethod_value();

  $sqlStat = "SELECT spe_name_la,
                     gen_name_la,
                     fam_name_la,
                     ord_name_la,
                     cla_name_la,
                     phy_name_la
              FROM local_plants
							WHERE spe_no = " . $_GET["spe_no"];
	_console_OP_sqlStatment($sqlStat);

  if($sqlStat->errno != 0){
    echo "sqlstmt have error!" . "<br/>";
    echo $sqlStat->errno . "<br/>";
    echo $sqlStat->error . "<br/>";
  }

	$sqlResult = $mydbconn->query($sqlStat);
	if($sqlResult){
      $sqlcont = $sqlResult->fetch_assoc();
			echo "<div id = specie_info>";
			echo "<p><b>the specie of plant was found!:</b></p>";
      echo "<p>specie information:</p>";
			$info =  "<img src = \"#\" style=\"height:300px;width:300px;border:solid 1px black;\">" .
							 "<p id = spe_desc>" . "specie: " . $sqlcont["spe_name_la"] . "</p>" .
               "<p id = gen_desc>" . "genus: " . $sqlcont["gen_name_la"] . "</p>" .
               "<p id = fam_desc>" . "family: " . $sqlcont["fam_name_la"] . "</p>" .
               "<p id = ord_desc>" . "order: " . $sqlcont["ord_name_la"] . "</p>" .
               "<p id = cla_desc>" . "class: " . $sqlcont["cla_name_la"] . "</p>" .
               "<p id = phy_desc>" . "phylum: " . $sqlcont["phy_name_la"] . "</p>";
			echo $info;
			echo "</div>";
	}else{
		echo "SQL query fail!";
	}
?>
</body>
</html>
